CREATE TABLE [dbo].[Reader]
(
[Id] [int] NOT NULL,
[Name] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Sex] [int] NULL,
[ReaderTypeId] [int] NULL,
[LocationId] [int] NULL,
[SocialId] [nchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Email] [nvarchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Phone] [nchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ImageId] [int] NULL,
[Status] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Reader] ADD CONSTRAINT [PK_Reader] PRIMARY KEY CLUSTERED  ([Id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Reader] ADD CONSTRAINT [FK_Reader_Image] FOREIGN KEY ([ImageId]) REFERENCES [dbo].[Image] ([Id])
GO
ALTER TABLE [dbo].[Reader] ADD CONSTRAINT [FK_Reader_Location] FOREIGN KEY ([LocationId]) REFERENCES [dbo].[Location] ([Id])
GO
ALTER TABLE [dbo].[Reader] ADD CONSTRAINT [FK_Reader_ReaderType] FOREIGN KEY ([ReaderTypeId]) REFERENCES [dbo].[ReaderType] ([Id])
GO
